|
Table of Contents
NOTE: you can find this and other lessons in a
more complete and viewable format (including all Figures) in our Tutorial PDF.
Lesson 6. Improving the Appearance of your Report
-
This lesson teaches you how to specify your own formatting options for a report. The formatting options discussed are:
-
display formats (which determine how dates, times and numbers are formatted)
-
column headings
-
column widths
-
the
BIZ
(blank if zero) parm
-
the
ACCUM
/
NOACCUM
parms (for totalling or not totalling a column)
-
Now that your report contains the data that you need, it is time to think about its appearance. Just because Spectrum SMF Writer can produce new reports quickly doesn't mean that the report has to look "quick and dirty" at all. This lesson lets you give your report that professional look, as if it were made with a custom report program.
Using Display Formats
-
When it comes time for Spectrum SMF Writer to move raw data from the SMF record into the report line, it must decide exactly how to format the data. The format used is called the display format. Spectrum SMF Writer supports quite a number of different display formats, depending on the data type of the field. The following table contains a partial list of the more commonly used display formats. (A complete list can be found in .)
-
Type of Data
|
-
Display Format
|
-
Description/Example
|
-
Date
|
-
MM-DD-YY
|
-
12/31/10
(this is the default format for dates)
|
-
MM-DD-YYYY
|
-
12/31/2010
|
-
DD-MM-YYYY
|
-
31/12/2010
|
-
SHORT1
|
-
DEC 31, 2010
|
-
SHORT2
|
-
31 DEC 2010
|
-
SHORT3
|
-
31 DEC 10
|
-
LONG1
|
-
DECEMBER 31, 2010
|
-
LONG2
|
-
31 DECEMBER 2010
|
-
Time
|
-
HH-MM-SS
|
-
13:59.59.123...
(this is the default format for times)
|
-
HH-MM
|
-
14:00
(time rounded to minutes)
|
-
Numeric
|
-
DOTSEP
|
-
1.234.567,98 (dots for thousands separator, comma for decimal digits)
|
-
DISPLAY
|
-
0123M (no leading zero suppression, no commas, sign in zone nibble of last digit)
|
-
PIC'ZZ9.9'
|
-
User specified "picture", similar to COBOL's PIC
|
-
DOLLAR
|
-
$123.45 (with floating dollar sign)
|
-
Any
|
-
HEX
|
-
1234ABCD (shows raw data in hex format)
|
-
BITS
|
-
00010011 (shows each bit in the raw data)
|
-
When no display format has been specified by the user (as in most of the earlier examples in this tutorial), Spectrum SMF Writer uses a default display format. To specify your own format, just put the name of a display format in parentheses immediately after the field name in your control statement. (Do not leave a space between the field name and the open parenthesis.) Display formats are allowed in
COLUMNS
,
TITLE
and other statements that produce report output.
-
For example:
TITLE: 'DAILY SMF ABSTRACT FOR' #DATE(LONG1)
COLUMNS: SMF30DTE(SHORT3) SMF30TME(HH-MM) EXCP-CHARGE(DOLLAR) SMF30SCC(HEX)
-
The display formats within parentheses after the field names above specify how the fields will be formatted in the report.
-
Figure _ shows a report that uses display formats.
Customizing a report by using display formats, column headings, override widths and more
Customizing a report by using display formats, column headings, override widths and more
|
Specifying Column Headings
-
Another way to improve your report is by providing your own column headings. You remember that Spectrum SMF Writer uses the field name itself as the default column heading. (And most field names in the SMF files are not exactly self-explanatory.)
-
To specify your own column heading, just place the desired heading text in parentheses after the field name in the
COLUMNS
statement. To break your column heading text into multiple lines, use a vertical bar (|) as the separator character. For example:
COLUMNS: SMF30BLK('EXCP|BLOCK|COUNT')
-
In the above statement, we specified our own column heading for the
SMF30BLK
field. As you can see in the report in Figure _, the
SMF30BLK
column now has
EXCP, BLOCK
, and
COUNT
stacked over it as a 3-line column heading.
Specifying a Column's Width
-
You can also specify the exact number of bytes to use for a particular column in your report.
-
When no column width is specified, Spectrum SMF Writer chooses a default column width. You may want a larger column width (to hold big numeric values, for example). Or you may want a smaller column width (perhaps to truncate a long character field so that you can squeeze more columns into your report).
-
Just specify the number of bytes you want for a particular column in parentheses after the field name. For example:
COLUMNS: SMF14_JFCBDSN(20)
-
The above statement tells Spectrum SMF Writer to shorten the long 44-byte
DSN
field to just the first 20 bytes, to save space in the report.
The Blank-If-Zero Parm
-
Many SMF reports are written to search out exceptional situations. To help make unusual values stand out in a report, it is often help to show blanks for all 0 values. (Especially when the 0 value is 11 bytes long, like a 00:00:00.00 time interval which can really clutter a report.) To do that, specify the
BIZ
parm in parentheses after the field name. For example:
COLUMNS: SMF30BLK('EXCP|BLOCK|COUNT' BIZ 6)
-
The report in Figure _ uses the
BIZ
parm shown above. The report lines with a zero
EXCP
count now have blanks in that column, allowing the non-zero values to stand out.
-
in the example statement above we also specified override column headings and an override width. This illustrates the fact that you can specify more than one override for a single field. Their order within the parentheses is not important. You can separate the overrides with spaces and/or commas.
Which Columns Are Totalled?
-
You can also specify exactly which columns receive totals in your report. By default, all numeric fields are totalled. However, this is obviously not desirable for certain numeric fields (such as
LRECL
, record type, etc.) To suppress totals for a particular numeric column, specify the
NOACCUM
parm for that field. That tells Spectrum SMF Writer not to "accumulate" it for printing in statistic lines, of which the total line is the most common. (Some other statistic lines available are
MAX
,
MIN
,
AVG
, and
STDDEV
. The
NOACCUM
parm also applies to all of these).
-
You can also specify
ACCUM
to force a column to be totalled. A common example of the need for this is with fields that contain time intervals (as opposed to time-of-day values). By default, Spectrum SMF Writer does not print totals for any time field. Just specify an
ACCUM
parm for any time fields that you want totals for.
COLUMNS: SMF14LRECL(NOACCUM) SMF14RTY(NOACCUM)
COLUMNS: SMF30TCN('TOTAL|DEVICE|CONNECT|TIME', ACCUM)
-
to avoid having to specify
ACCUM
and
NOACCUM
parms in every report you make, consider adding the appropriate parm to the definitions of commonly used fields in your copy library. Just locate the
FIELD
statement you want, and add either an
ACCUM
or
NOACCUM
parm to the statement. For example:
FIELD: SMF30TCN DISP(18) LEN(4) TYPE(BU-SECS) ACCUM /* ALWAYS TOTAL */
Formatting Features for International Customers
-
Here are some formatting tips of special interest to our international customers.
-
You may want to change the default way in which dates and numbers are formatted (rather than specifying it for every individual field in the report). The
FORMAT
option lets you do this easily. Put the following statement near the beginning of your control statements.
OPTIONS: FORMAT(DD-MM-YY, DOTSEP)
-
This statement makes
DD-MM-YY
the default format for all dates in the report. And it makes the
DOTSEP
format the default for all numeric fields.
-
You can also change the delimiter that Spectrum SMF Writer uses when it formats dates and time in the report. For example:
OPTIONS: DATEDELIM('-') TIMEDELIM('.')
-
The statement above would cause dates to be formatted like this:
31-12-10
. And time fields would look like this:
12.34.56
. Of course, you can use the delimiter character of your choice.
-
And don't forget this option that was mentioned in an earlier lesson:
OPTION: DDMMYYLIT
-
This option lets you use
DD/MM/YY
format date literals when writing your control statements. Note that the delimiters specified by the
DATEDELIM
and
TIMEDELIM
options apply only to formatting data to display in the report. The delimiters used to write date and time literals (in the control statements) can not be changed. Always use slashes for dates and colons for times in your literals.
-
You can put all of these options on a single OPTION statement, of course. An easy way to specify these options for all reports is to put them in a new member of your Spectrum SMF Writer copy library. Then either copy that member each time with a
COPY
statement, or add a
SWOPTION DD
in your execution JCL to copy them automatically.
Summary
-
Here is a summary of what we learned in this lesson:
-
use an override display format to change the way data is formatted in a report
-
use override column headings to change the column headings in a report
-
specify a column width to change the width of a column in a report
-
use the BIZ parm to blank out zero values
-
use the
ACCUM
or
NOACCUM
parms to specify which columns to show totals for
-
each of these overrides should be put in parentheses after the appropriate field name
-
you can specify multiple overrides for a field, all within the same parentheses
-
use the
FORMAT
option to change the default display format for all fields in a report
-
several options exist to help format reports using international conventions
-
The next lesson will teach you how to create your own new fields to use in your report.
To Learn More
-
You can also learn:
-
how to left-justify, center or right-justify data within its column ()
-
how to blank out repeating values in a column()
-
how to change the spacing between columns in a report ()
-
the complete syntax for the
COLUMNS
statement, in .
NEXT LESSON: How to Create Your Own Fields
|